deploy: Return staged deployment
authorColin Walters <walters@verbum.org>
Fri, 27 Apr 2018 19:33:02 +0000 (15:33 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 27 Apr 2018 19:41:19 +0000 (19:41 +0000)
Today rpm-ostree has some code to run a "sanitycheck" on a deployment.
I had initially deleted that when adapting it to use the staging code,
but I realized it should work fine; we just won't see the merged
config, but that's OK.

When I readded that code it started crashing because we didn't
actually return the new deployment object.  We'll gain some coverage
here as I'll land the code to have rpm-ostree use staging, then bump
the rpm-ostree tests here.

Closes: #1559
Approved by: jlebon

src/libostree/ostree-sysroot-deploy.c
src/ostree/ot-admin-builtin-deploy.c

index b573325cba1fd632b8364fb7badf1a4ad4608de3..4314520a8e3f3de91572627152c3683065168cb2 100644 (file)
@@ -2736,6 +2736,7 @@ ostree_sysroot_stage_tree (OstreeSysroot     *self,
   if (!ostree_sysroot_load (self, cancellable, error))
     return FALSE;
 
+  ot_transfer_out_value (out_new_deployment, &deployment);
   return TRUE;
 }
 
index 0a1755fda272d5db9e4f37dfdcf43f838999d887..38ec923f7e6913e101f21e85ee51d840ad815357 100644 (file)
@@ -178,12 +178,14 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeCommandInvocation *invocat
       if (!ostree_sysroot_stage_tree (sysroot, opt_osname, revision, origin, merge_deployment,
                                       kargs_strv, &new_deployment, cancellable, error))
         return FALSE;
+      g_assert (new_deployment);
     }
   else
     {
       if (!ostree_sysroot_deploy_tree (sysroot, opt_osname, revision, origin, merge_deployment,
                                        kargs_strv, &new_deployment, cancellable, error))
         return FALSE;
+      g_assert (new_deployment);
 
       OstreeSysrootSimpleWriteDeploymentFlags flags = OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN;
       if (opt_retain)